//TODO:Parse some general command-line options
#include <buola/gui.h>

#include <buola/app/ceventloop.h>
#include <buola/gui/cwindow.h>
#include <buola/gui/ctoolkit.h>
#include <buola/gui/caccelerator.h>
#include <buola/gui/cconfig.h>
#include <buola/gui/cphysicalwindow.h>
#include <buola/gui/cwindow.h>
#include <buola/gui/cwindowmanager.h>
#include <buola/app/ceventloop.h>

namespace buola { namespace gui {

bool CToolkit::mServerDown=false;

CToolkit::CToolkit()
{
    for(int i=0;i<CClipboard::CB_COUNT;i++)
        mClipboards[i]=nullptr;
}

CToolkit::~CToolkit()
{
}

CPoint_d CToolkit::GetMousePos(CWindow *pWindow)
{
    CPoint_d lInWindow,lInScreen;

    if(pWindow)
    {
        CPhysicalWindow *lPhysical=pWindow->GetTopLevel()->Physical();
        if(!lPhysical) return nUndefined;
        
        QueryPointer(lPhysical,lInWindow,lInScreen);
        return lInWindow;
    }
    else
    {
        QueryPointer(nullptr,lInWindow,lInScreen);
        return lInScreen;
    }
}

/////////////////////////////////////////////////////////
///////////////////// internal //////////////////////////
/////////////////////////////////////////////////////////

void CToolkit::Start()
{
    gConfig.Init();
}

void CToolkit::Finish()
{
}

/*namespace gui*/ } /*namespace buola*/ }
